//    Copyright 2021 Cardinal
//
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//
//        http://www.apache.org/licenses/LICENSE-2.0
//
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.

package per.n.homework;

public final class App {
    private App() {
    }

    public static void main(String[] args) {
        ShowStudentsCount();
        Student[] students = new Student[2];
        ShowStudentsCount();
        students[0]=new Student();
        students[0].setName("无名氏-1");
        students[0].setGrade(59);
        students[1] = new Student("无名氏",60);
        ShowStudentsInfo(students);
        ShowStudentsCount();
        new Student();
        ShowStudentsCount();
        for (int i = 0; i < 1000; i++)
        {
            new Student();
        }
        ShowStudentsCount();
    }

    private static void ShowStudentsCount() {
        System.out.println("数量："+ Student.getCreatedStudentCount());
    }

    private static void ShowStudentsInfo(Student[] students)
    {
        for (var s : students) {
            System.out.println("姓名" + s.getName() + " 成绩：" + s.getGrade());
        }
    }
}
